import { v4 as uuidv4 } from 'uuid'


// 生成随机字符串，永久保存
export const getUUId = () => {
  // 先判断有没有
  let uuid_token = localStorage.getItem('UUID_Token')
  // 没有就随机生成
  // 只生产一次
  if (!uuid_token) {
    uuid_token = uuidv4()
    localStorage.setItem('UUID_Token', uuid_token)
  }
  return uuid_token
}